/*
    The NeonX Library

    Copyright (c) 2013 darkcat

    Code covered by the MIT License
*/

#pragma once

// nx...
#include "config/general.h"
// NX_ALLOC
#include "memory/memalloc.h"

// std::set
#include <set>

//////////////////////////////////////////////////////////////////////////
NX_BEG
//////////////////////////////////////////////////////////////////////////

template <typename Key_, typename Comp_ = std::less<Key_>, class Alloc_ = NX_ALLOC>
class set : public std::set<Key_, Comp_, typename Alloc_::template Allocator<Key_>::ret>
{
public:
    typedef std::set<Key_, Comp_, typename Alloc_::template Allocator<Key_>::ret> base_t;

public:
    set()
        : base_t()
    {}
    set(const base_t& x)
        : base_t(x)
    {}

#ifdef NX_CC_MSVC
    explicit set(const Comp_& c,
                 const typename base_t::allocator_type& a = base_t::allocator_type())
            : base_t(c, a)
    {}
#elif defined(NX_CC_GNUC)
    explicit set(const Comp_& c,
                 const typename base_t::allocator_type& a = typename base_t::allocator_type())
            : base_t(c, a)
    {}
#endif

    template <typename Iterator_>
    set(Iterator_ f, Iterator_ l)
        : base_t(f, l)
    {}
    template <typename Iterator_>
    set(Iterator_ f,
        Iterator_ l,
        const Comp_& c,
        const typename base_t::allocator_type& a = typename base_t::allocator_type())
        : base_t(f, l, c, a)
    {}
};

//////////////////////////////////////////////////////////////////////////
NX_END
//////////////////////////////////////////////////////////////////////////
